package com.dudy.stragy;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: zhuguangDemo
 * @description: ${description}
 * @author: dudy
 * @create: 2018-04-05 21:23
 **/
public class TestMain {
    public static void main(String[] args) {
        Province hunan = new Hunan();
        Province hubei = new Hubei();
        Province jiangxi = new JiangXi();
        Map<String,Province> map = new HashMap<>();
        map.put("hunan", hunan);
        map.put("hubei", hubei);
        map.put("jiangxi", jiangxi);
        String type = "jiangxi";
        for (Map.Entry<String,Province> entry : map.entrySet()) {
            if (entry.getValue().isMyJob(type)) {
                entry.getValue().todo(type);
            }
        }
    }
}
